package org.example.ruoxing_admin_springboot3.controller.systemResources;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.example.ruoxing_admin_springboot3.dto.SystemResourcesDto;
import org.example.ruoxing_admin_springboot3.httpResponseResult.ResponseResult;
import org.example.ruoxing_admin_springboot3.service.resources.SystemResourcesService;
import org.springframework.web.bind.annotation.*;
/**
 * @description 系统资源
 * @author 莫若省
 * @createTime 2024/5/6
*/
@Tag(name = "系统配置中/资源管理接口")
@RestController
public class SystemResourcesController {
    @Resource
    private SystemResourcesService systemResourcesService;
    @Operation(summary = "获取全部系统资源列表的接口")
    @GetMapping("/system/resources")
    public ResponseResult<Object> getSystemResources(@RequestHeader("x-access-token") String token) {
        return systemResourcesService.getAllSystemResources();
    }
    @Operation(summary = "新增系统资源的接口")
    @PostMapping("/system/resources/add")
    public ResponseResult<Object> addSystemResources( @RequestHeader("x-access-token") String token, @RequestBody SystemResourcesDto systemResourcesDto ) {
        return systemResourcesService.addSystemResources(systemResourcesDto);
    }
}
